home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18007 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.sprintlink.net!datalytics!usenet
  2. From: Rob Stewart <stew@datalytics.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: bitfield
  5. Date: Thu, 18 Apr 1996 10:22:54 -0400
  6. Organization: Datalytics, Inc
  7. Message-ID: <3176503E.42A0@datalytics.com>
  8. References: <3172B547.1F54@braunschweig.netsurf.de> <Pine.LNX.3.91.960417052937.630D-100000@mittens.stu.rpi.edu>
  9. NNTP-Posting-Host: 204.62.224.71
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-1
  12. Content-Transfer-Encoding: quoted-printable
  13. X-Mailer: Mozilla 2.0 (WinNT; I)
  14.  
  15. Kengo Hashimoto wrote:
  16. > =
  17.  
  18. > On Mon, 15 Apr 1996, Dieter L=FCcking wrote:
  19. > =
  20.  
  21. > > Problem:
  22. > >
  23. > >         struct BITS
  24. > >         {
  25. > >           int bits : 3;
  26. > >         };
  27. > >
  28. > >         BITS array[8];
  29. > >
  30. > > How much memory needs array ?
  31. > >
  32. > > Danke Dieter
  33. > =
  34.  
  35. > Simple. Do a sizeof(array) and it'll return the value. =3D]
  36. > =
  37.  
  38.  
  39. That's the right answer, since the layout of bitfields, and =
  40.  
  41. structs in general, is implementation dependent.
  42.  
  43. -- =
  44.  
  45. Robert Stewart        | My opinions are usually my own.
  46. Datalytics, Inc.    | stew@datalytics.com
  47.